package com.wen.yygh.hosp.controller;

import com.wen.yygh.common.result.Result;
import com.wen.yygh.hosp.service.DepartmentService;
import com.wen.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author Wenjl
 */
@RestController
@RequestMapping("/admin/hosp/department")

@Api(tags = "科室管理")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    @GetMapping("departmentList/{hoscode}")
    @ApiOperation("获取部门列表")
    public Result getDepartmentListByHoscode(@PathVariable("hoscode") String hoscode) {
        List<DepartmentVo> departmentVoList = departmentService.getDepartmentListByHoscode(hoscode);
        return Result.ok(departmentVoList);

    }
}
